package com.benny_driving_dri.thread;

import com.benny_driving_dri.act.TaximeterAct2;
import com.benny_driving_dri.dao.impl.HttpDaoImpl;

public class GetTimeForTaximeter2Thread extends Thread {
	private String jsession;

	public GetTimeForTaximeter2Thread(String jsession) {
		this.jsession = jsession;
	}

	@Override
	public void run() {
		long resData = new HttpDaoImpl().getTime(jsession);
		if (resData == 0l || resData == 12l || resData == -1)
			TaximeterAct2.handler.sendMessage(TaximeterAct2.handler
					.obtainMessage(0, TaximeterAct2.HANDLER_KEY_STARTMIL,
							TaximeterAct2.HANDLER_STATE_FAIL));
		else
			TaximeterAct2.handler.sendMessage(TaximeterAct2.handler
					.obtainMessage(0, TaximeterAct2.HANDLER_KEY_STARTMIL,
							TaximeterAct2.HANDLER_STATE_SUCCESS, resData));
	}
}
